<template>
	<view id="wrap" class="dis_cc fdc">
		<map :rotate="rotate" :latitude="latitude" :longitude="longitude" :markers="covers" :polyline="polyline"></map>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'map',
				latitude: 39.909,
				longitude: 116.39742,
				covers: [{
					id:1,
					width:30,
					height:40,
					latitude: 39.909,
					longitude: 116.39742,
					// iconPath: '../../../static/location.png'
				}, {
					id:2,
					width:30,
					height:40,
					latitude: 39.90,
					longitude: 116.39,
					// iconPath: '../../../static/location.png'
				}],
				polyline: [{
					width: 8,
					color: '#27bd09e6',
					points: [
						{
							latitude: 39.909,
							longitude: 116.39742
						},
						{
							latitude: 39.90,
							longitude: 116.39,
						}
					]
				}],
				rotate: 90
			};
		},
		onShow() {
			uni.getLocation({
				type: 'gcj02',
				success: (res) => {
					this.latitude = 39.909
					this.longitude = 116.39742
				}
			})
		}
	}
</script>

<style lang="scss" scoped>
	#wrap {
		map {
			width: 100vw;
			height: 100vh;
		}
	}
</style>